--- import BaseLayout from "../../../../layouts/BaseLayout.astro"; import { Header } from "../../../../components/layout/Header"; import { Card, CardContent, CardHeader, CardTitle } from "../../../../components/ui/card"; import { Button } from "../../../../components/ui/button"; import { Badge } from "../../../../components/ui/badge"; import { Star, GitFork, Copy, ExternalLink, Code, BookOpen, ArrowLeft, Terminal, Globe, Check, ShieldAlert, Server } from "lucide-react"; import { verifyToken } from "../../../../lib/auth"; import { getDb } from "../../../../lib/db"; import { eq, and } from "drizzle-orm"; import { cachedRepos, instances, stars } from "../../../../lib/db/schema"; const token = Astro.cookies.get("community_session")?.value; const user = token ? await verifyToken(token) : null; const { instance, owner, repo } = Astro.params; const fullName = `${owner}/${repo}`; const db = getDb() as any; // Find the instance first const instanceData = await db.query.instances.findFirst({ where: eq(instances.name, instance as string) }).catch(() => null); // Then find the repo let repoData = null; if (instanceData) { repoData = await db.query.cachedRepos.findFirst({ where: and( eq(cachedRepos.instanceId, instanceData.id), eq(cachedRepos.fullName, fullName) ) }).catch(() => null); } // Check if current user has starred this repo let isStarred = false; if (user && repoData) { const existingStar = await db.query.stars.findFirst({ where: and( eq(stars.userId, user.sub), eq(stars.repoId, repoData.id) ) }).catch(() => null); isStarred = !!existingStar; } const starCount = repoData?.starCount ?? 0; const forkCount = repoData?.forkCount ?? 0; const httpCloneUrl = repoData?.httpCloneUrl ?? `https://${instance}/${fullName}.git`; const language = repoData?.language ?? "Unknown"; const description = repoData?.description ?? "No description provided."; ---
Explore / {instanceData ? ( {instance} ) : ( {instance} )} / @{owner} / {repo}

{fullName}

{repoData?.visibility || "public"}

{description}

git clone {httpCloneUrl}
About This Federated Project

This repository is hosted natively on the {instance} node and aggregated to the community catalog via federated metadata caching.

To browse source files, commits, issues, and pull requests directly, click the View Origin button above to visit the home node.

How to Fork & Contribute
  1. Clone the repository using standard Git: git clone {httpCloneUrl}
  2. Make your changes locally and commit them to a new branch.
  3. Push the branch to your own self-hosted OpenCodeHub node.
  4. Submit a cross-node federated pull request to @{owner}.

Project Details

Primary Language {language}
Stars {starCount}
Forks {forkCount}
Host Node {instance}
Community Social Actions:

Stars registered on this hub are stored in the federated catalog. To star directly on the origin server, sign into that node.